<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>

<html>
<head>
    <title>emplist</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/ems/css/style.css"/>
    <link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/ems/css/common.css"/>
    <script type="text/javascript" src="${pageContext.request.contextPath }/ems/js/jquery-1.8.3.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath }/ems/js/time.js"></script>


</head>
<body>
<div id="wrap">
    <div id="top_content">
        <div id="header">
            <div id="rightheader">
                <p>
                    <span id="time"></span>
                    <script type="text/javascript">
                        showtime();
                    </script>
                    <br/>
                </p>
            </div>
            <div id="topheader">
                <h1 id="title">
                    <a href="#">main</a>
                </h1>
            </div>
            <div id="navigation">
            </div>
        </div>
        <div id="content">
            <p id="whereami">
            </p>
            <h1 style="display: inline-block">
                Welcome!

            </h1>
           <span style="display: inline-block;color: #3366cc;margin-left: 300px;" >
               ${user.username}
           </span>

            <table class="table">
                <tr class="table_header" style="text-align: center;">
                    <td style="width:200px;">
                        ID
                    </td>
                    <td style="width:200px;">
                        Name
                    </td>
                    <td style="width:200px;">
                        Salary
                    </td>
                    <td style="width:200px;">
                        deptid
                    </td>
                    <td style="width:200px;">
                        Birthday
                    </td>
                    <td style="width:800px;">
                        Operation
                    </td>
                </tr>
                <%--
                items="${emps}"  获取request作用域中集合
                var="emp" 一个临时变量
                varStatus="sta"  变量的状态信息
                --%>
                <c:forEach var="emp" items="${emps}" varStatus="sta">
                    
                    <c:choose >
                            <c:when test="${sta.index % 2 == 0}">
                                <tr style="background-color: #d6c8e069;font-weight: normal;font-size: 14px;height: 50px;text-align: center">
                            </c:when>
                            <c:otherwise>
                                <tr style="background-color: #92e4d9;font-weight: normal;font-size: 14px;height: 50px;text-align: center">
                            </c:otherwise>
                    </c:choose>
                            <td>
                                    ${emp.id}
                            </td>
                            <td>
                                    ${emp.name}
                            </td>
                            <td>
                                    ${emp.salary}
                            </td>
                            <td>
                                    ${emp.deptId}
                            </td>
                            <td>
                                    ${emp.birthday}
                            </td>
                            <td>
                                <a href="/ems/emp/delete?id=${emp.id}"/>delete emp</a>&nbsp;
                                <a href="/ems/emp/detail?id=${emp.id}">update emp</a>&nbsp;
                                <a href="/ems/emp/downLoadEmpInfo?id=${emp.id}">downlaod info</a>&nbsp;
                            </td>
                        </tr>

                    

                </c:forEach>


            </table>
            <div class="pagination">
                <span class="firstPage">&nbsp;</span>
                <span class="previousPage">&nbsp;</span>
                <span class="currentPage">1</span>
                <a href="javascript:$.pageSkip(2);">2</a>
                <a href="javascript:$.pageSkip(3);">3</a>
                <span class="pageBreak">...</span>
                <a class="nextPage" href="javascript:$.pageSkip(2);">&nbsp;</a>
                <a class="lastPage" href="javascript:$.pageSkip(6);">&nbsp;</a>
                <span class="pageSkip"> 共6页 到第
						<input id="pageNumber" name="pageNumber" value="1" maxlength="9" onpaste="return false;">页
							<button type="submit">&nbsp;</button>
						</span>
            </div>
            <p>
                <input type="button" class="button" value="Add Employee" onclick="add()"/>

            </p>
        </div>
    </div>
    <div id="footer">
        <div id="footer_bg">
            ABC@126.com
        </div>
    </div>
</div>
<script type="text/javascript">
    function add(){
        location.href = "/ems1/ems/emp/addEmp.jsp";
    }
</script>
</body>
</html>
